package com.atguigu.e_changeargs;

public class Demo {
    public static void main(String[] args) {


        method("张三");
        method("张三","李四");
        method("张三","李四","王五");


        show("1",2,3,4,5,6,7,8,9,10);

        int[] arr = {1,2,3,4,5};
        show("2",arr);
    }

    //(数据类型...变量名)
    public static void show(String a,int...num){ //元素求和
        int sum = 0;
        for (int i = 0; i < num.length; i++) {
            sum += num[i];
        }
        System.out.println(sum);
    }



    public static void method(String...names){

    }
}
